UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eDMOdy62/fuknksJXXHUCcpknFHji4RhDwFIrBEbOyg=' 
WHERE 
  key_id = '94cdfba64c2f69e7401d320d628c787f0e67cb17a87d7b2bdc9dbea152952368' 
  AND (
    token = 'eDMOdy62/fuknksJXXHUCcpknFHji4RhDwFIrBEbOyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00255