UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tcz65ElhwHSbWpq+SqytTT5c321laCQ5HOFERMQ4WnA='
WHERE
key_id = 'bc70f38c941a609bbae314fa53295d0663e1f61e190e35b1bae682c1780b33a2'
AND (
token = 'Tcz65ElhwHSbWpq+SqytTT5c321laCQ5HOFERMQ4WnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)