UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eUJtRzZCUNxo9CYPsS6ILfkFfmGLDIaepbqbp8LprHg=' 
WHERE 
  key_id = '485afc8d8fe65d27e1bd0795b0be5d57d3378319181370732c88f3605c062386' 
  AND (
    token = 'eUJtRzZCUNxo9CYPsS6ILfkFfmGLDIaepbqbp8LprHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017