UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1JZzIWbTcBW3JXNWrJCbTBgPHP2nQvL7lp8D0sgbxlY=' 
WHERE 
  key_id = '4b12d2f17f362e26133f98cf52015fedf991202760aabfce0ce8046f3c09c192' 
  AND (
    token = '1JZzIWbTcBW3JXNWrJCbTBgPHP2nQvL7lp8D0sgbxlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054