UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x+lLGHrGyTz4W2jOkRHEUTQrFzE7PStyslfEp0r4V1g='
WHERE
key_id = '7b707cfd2033f2102b186c460deec49636d5a627bcc9ee1b9d52a42f1533e184'
AND (
token = 'x+lLGHrGyTz4W2jOkRHEUTQrFzE7PStyslfEp0r4V1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)