UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3iGtxy1bcu/LHVyzWom9zbXcD05I4hv4ddo4P5QPUXo=' 
WHERE 
  key_id = '8df03da41bc95a326bead4fcbf53854f3b244dcf7fe1532c8de24ceac6e1b4f4' 
  AND (
    token = '3iGtxy1bcu/LHVyzWom9zbXcD05I4hv4ddo4P5QPUXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039