UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sjamoc1p2mS5LeFXQiXOele+OVlq5QP77P3idHGqSkg=' 
WHERE 
  key_id = 'be599bc4de66d70c319c01f110c22927362cb83d007afa87b278c36825f4a88b' 
  AND (
    token = 'Sjamoc1p2mS5LeFXQiXOele+OVlq5QP77P3idHGqSkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015