UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDow7Jqlr/gKcSaEcwE/1MT3aZ385tFzwZB+XCHNIKs='
WHERE
key_id = 'bb8e006c620aaf5d89ed50dcd8ab02a5a1d15f43fcc408200b5a6b82b5cfb1da'
AND (
token = 'jDow7Jqlr/gKcSaEcwE/1MT3aZ385tFzwZB+XCHNIKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)