UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4GNu6fakGwWd1fZeYPWXDWBQfpsW/tvQEd5tas/Ed8c=' 
WHERE 
  key_id = '27d53e7ce7444ca04f322cea1ebfdc8eb970db5217fd8a180fa7ce56713fdb57' 
  AND (
    token = '4GNu6fakGwWd1fZeYPWXDWBQfpsW/tvQEd5tas/Ed8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042