UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F9OsLRuVd1v84I+POwOC7v4kpjBexTj/1E15w6jiXms=' 
WHERE 
  key_id = '75f6574d4d3e3514ee068b02ffdc47fa0ea68f1525dcf8505291ddc20d2a5dc8' 
  AND (
    token = 'F9OsLRuVd1v84I+POwOC7v4kpjBexTj/1E15w6jiXms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027