UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VLsUwvjEZ0OraT1jwHyJgjy3Q6eZ9Fgk1xyXBo5GaCk='
WHERE
key_id = '77be70408b327a2569210bbb86f6d7b37566b857f5f60c3f0b19741b62bf2d13'
AND (
token = 'VLsUwvjEZ0OraT1jwHyJgjy3Q6eZ9Fgk1xyXBo5GaCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)