UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7tTOxjP4D2E+RQIK3cX+Yy6pdLuqrIqwWc7J1PKFgd8='
WHERE
key_id = '2d4c92c915d90a23c6b3674a73c1f3d2274c91edd9ef7e05b1b99b0d473d6b6b'
AND (
token = '7tTOxjP4D2E+RQIK3cX+Yy6pdLuqrIqwWc7J1PKFgd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)