UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kYORu2poytfT83eWRCEi+QP2kpqunS+gfndc83DQp4=' 
WHERE 
  key_id = '001ea2619fc04e749fc739446b1f4a38aa903f43072b1a6d376691a80a14fba4' 
  AND (
    token = '6kYORu2poytfT83eWRCEi+QP2kpqunS+gfndc83DQp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025