UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4iPEdHGMd4T1m7xnoeQhwTAaFpFBvJiY14J4BVGLZ7w='
WHERE
key_id = 'f56df7f12a55eab4974110b0dceddff338d4851643434820e55adbc0aa7c076e'
AND (
token = '4iPEdHGMd4T1m7xnoeQhwTAaFpFBvJiY14J4BVGLZ7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)