UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZoqFxWIAdGWyP0pWBpSedncphBkx4N4mlAQa6REXiVk=' 
WHERE 
  key_id = 'c261b146609d4d2f10a98096d44480722727bbe1ab2ea09a8f15235eba9bbae9' 
  AND (
    token = 'ZoqFxWIAdGWyP0pWBpSedncphBkx4N4mlAQa6REXiVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059