UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hl9+ok/wysIJJ8eOOTAJ0/KcQ7f8hRdks30mie3aoHw=' 
WHERE 
  key_id = '42518160409e0fe310e040c1848e51a81b5e4d0fc781234cf51b7320cbaf5d3e' 
  AND (
    token = 'hl9+ok/wysIJJ8eOOTAJ0/KcQ7f8hRdks30mie3aoHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030