UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hNneMTP7zB5VbkHV/loa0X4XgjWxPyIJUOn5aljpUBI='
WHERE
key_id = 'f74dcc3cfe38a29d94cba339230127cecb5f3cdb202427e1859f39dd45101e0e'
AND (
token = 'hNneMTP7zB5VbkHV/loa0X4XgjWxPyIJUOn5aljpUBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)