UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DcaHo17k8TOgNkUVMb6Gb9PShyqfu4e1E0oFRUe1AtY='
WHERE
key_id = '357d2c9155553d92b947424cda8568fc804dc484cd14d370543a0c74b968a09c'
AND (
token = 'DcaHo17k8TOgNkUVMb6Gb9PShyqfu4e1E0oFRUe1AtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)