UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WE1LNe+MTStpJPZLqBl3tSMbR8/4hmOkECRovpYWrWc=' 
WHERE 
  key_id = '2018fcc82dc38b1904e7d98ef15d4d3ac2eae5c23073dff4e7e7733608806bb3' 
  AND (
    token = 'WE1LNe+MTStpJPZLqBl3tSMbR8/4hmOkECRovpYWrWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035