UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Z9YUYORnamltcAfiP3upik6sqlybSbO+uwfFXlgreY='
WHERE
key_id = 'd3e708764ed4b558f1c7ebf38c58182240a246ee5713af0e5f9b568cff6d3592'
AND (
token = '3Z9YUYORnamltcAfiP3upik6sqlybSbO+uwfFXlgreY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)