UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mIzZkYubnkxkN6rqKe//bF3BoJQV5bmm7tg8TQ06kHk='
WHERE
key_id = 'ec6dca62d6e785b77081212d94165ad391a1b5258ffa7a86f4de9f6413b55ef5'
AND (
token = 'mIzZkYubnkxkN6rqKe//bF3BoJQV5bmm7tg8TQ06kHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)