UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q8CTgB1eXNUOFfYiyzbYRlItyvVIhuEmEnJiupOKb60='
WHERE
key_id = '5901dd70af78d08345da29d26e3f29ed5cf1f45d1c5d02a26de715fc2b7de9b5'
AND (
token = 'q8CTgB1eXNUOFfYiyzbYRlItyvVIhuEmEnJiupOKb60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)