UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bydrr3kdKCyCr1A9P/BJYU4nY7kRLb88/xjzRfZQVPE=' 
WHERE 
  key_id = 'ec04b11dcd9bab818364775ff151ec27dceef911fc7956bc25970026b385fd5c' 
  AND (
    token = 'Bydrr3kdKCyCr1A9P/BJYU4nY7kRLb88/xjzRfZQVPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025