UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dYz4cKwICKuu/74O02vryNlC1zGSJnNGglgMQDB0Tm0='
WHERE
key_id = '5c2694387716db47373db37f37087dbfceaeaf0050e3e01c964b1929c1d20027'
AND (
token = 'dYz4cKwICKuu/74O02vryNlC1zGSJnNGglgMQDB0Tm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)