UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wxZirltjQL3XyX+tCbjlghYQ/cF2kbLjZ7dHZOywTSE=' 
WHERE 
  key_id = 'a4acc7ed4647ada5a792fa559bb300f7e22fb1ff4b4f2d5253527e61fbd0df01' 
  AND (
    token = 'wxZirltjQL3XyX+tCbjlghYQ/cF2kbLjZ7dHZOywTSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018