UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MofWs9XpmNULzP0uwGUowHTlasCFcQojDU5ZOX+IYh4='
WHERE
key_id = 'd0856273537c8bddeea9f6ab24f3f08d44eb85bfecd79c712a00e2063faf651a'
AND (
token = 'MofWs9XpmNULzP0uwGUowHTlasCFcQojDU5ZOX+IYh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)