UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hqCclUJFyA/GbM2+Y9X6AAca5WGxe/IHcafHhJTXm4M='
WHERE
key_id = '0dd8a2c8c7008491192f4f3edf73e74ab70c05796eabab06a0fc6ec73abb5f3d'
AND (
token = 'hqCclUJFyA/GbM2+Y9X6AAca5WGxe/IHcafHhJTXm4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)