UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uceExWe44rle+qkbbd34N64TeS1i97KrYtzrJ+ENqY='
WHERE
key_id = '1ac44fead84212584ef969caa9ca08958edee3166502cf6da55d1f182bcb5c25'
AND (
token = '1uceExWe44rle+qkbbd34N64TeS1i97KrYtzrJ+ENqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)