UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bW+q1CZdGP3iBCQ/TdxNQsBox1nUsRpE3QsqN+47mkc=' 
WHERE 
  key_id = '16c7e355e3749ed7d33189d33583f9778526fd30c669aa3499712a466f17a0bf' 
  AND (
    token = 'bW+q1CZdGP3iBCQ/TdxNQsBox1nUsRpE3QsqN+47mkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069