UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PWsa/UGlTGDYC7SrLrnMfOal4sWHNoTy0cuxgr8U/os='
WHERE
key_id = 'bd00c29f0c4a02fd38b56d3f7efcf0e7d0ad9d0bcc927d310282c4b5be6fdeba'
AND (
token = 'PWsa/UGlTGDYC7SrLrnMfOal4sWHNoTy0cuxgr8U/os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)