UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mp+FCB3Qht8RQc+NKV+3kQZ6WtfI6NIoT51msx/lyyY=' 
WHERE 
  key_id = 'e25904cbe417631cbada5d1fed920a7e421740841c8b1fb2404799aab415d0df' 
  AND (
    token = 'mp+FCB3Qht8RQc+NKV+3kQZ6WtfI6NIoT51msx/lyyY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068