UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ldgJVEX1w2KBcOWhs8lgT5l9V7QgBO8ujF2YzXc/91g='
WHERE
key_id = '2d2f5f836591cb46fb525e7c7ff7197c2b8cef33caabed60499e2e483f2ffae1'
AND (
token = 'ldgJVEX1w2KBcOWhs8lgT5l9V7QgBO8ujF2YzXc/91g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)