UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZlVDOmw3bosPbP3kEhElNAbfmeiqjFtuH3mpnKFY2iM='
WHERE
key_id = '507957ec4de86f3697113872ffd3796e02bc9ae91d90516cd6e35d394aa212a8'
AND (
token = 'ZlVDOmw3bosPbP3kEhElNAbfmeiqjFtuH3mpnKFY2iM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)