UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0qMwynFvH2I78usmKEyL8MHYMRMDMJU7hM/D6n7Cgq4='
WHERE
key_id = '570a1ff6acb09d62d4e4b22584c1562368e12e4cadb5a20379d7818c8a9f75fc'
AND (
token = '0qMwynFvH2I78usmKEyL8MHYMRMDMJU7hM/D6n7Cgq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)